home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
xyz21.zip
/
OLD2NEW.BAS
< prev
next >
Wrap
BASIC Source File
|
1992-04-16
|
1KB
|
43 lines
10 ' The old XYZ to new XYZ format
20 ' By Dale P. Stocker
30 ' Hope you don't mind real basic, but most people have it.
40 ' First what is the file to convert?
50 KEY OFF
60 CLS: COLOR 11,0
70 FILES "*.3DL"
80 LOCATE 23,1
90 COLOR 15,0
100 INPUT "What file do you wish to convert ";FILE$
110 ' Set a error trap if they make a mistake.
120 'ON ERROR GOTO 1000
130 ' Give the full file name and make a copy.
140 FILE$=FILE$+".3DL"
150 A$="Copy "+FILE$+" Temp.3DL"
160 SHELL A$
170 ' Now set up the fields for the old format
180 OPEN "R",#1,"Temp.3DL", 12
190 OPEN "R",#2,FILE$, 14
200 FIELD #1, 2 AS OX$, 2 AS OY$, 2 AS OZ$, 2 AS OXX$, 2 AS OYY$, 2 AS OZZ$
210 FIELD #2, 2 AS NX$, 2 AS NY$, 2 AS NZ$, 2 AS NXX$, 2 AS NYY$, 2 AS NZZ$, 2 AS NCL$
220 N1=LOF(1)/14
230 LSET NCL$=MKI$(7)
240 FOR K=1 TO N1
250 GET #1,K
260 LSET NX$=OX$ : LSET NY$=OY$ : LSET NZ$=OZ$
270 LSET NXX$=OXX$ : LSET NYY$=OYY$ : LSET NZZ$=OZZ$
280 'PRINT "X =";CVI(NX$);" Y=";CVI(NY$);" Z=";CVI(NZ$)
290 ' PRINT "old X =";CVI(OX$);" Y=";CVI(OY$);" Z=";CVI(OZ$)
300 'PRINT "XX=";CVI(NXX$);"YY=";CVI(NYY$);"ZZ=";CVI(NZZ$)
310 'PRINT "old XX=";CVI(OXX$);"YY=";CVI(OYY$);"ZZ=";CVI(OZZ$);" color=";CVI(NCL$)
320 A$=INPUT$(1)
330 PUT #2,K
340 NEXT K
350 CLOSE
360 KILL "temp.3dl"
370 PRINT "Conversion complete. "
380 END
390 CLS
400 COLOR 12,0
410 PRINT "Error detected... Code";ERR
420 END